package com.example.fanday.play.di.module;

import android.app.Activity;
import android.content.Context;

import com.example.fanday.play.cons.Dagger2Cons;
import com.example.fanday.play.di.scope.ContextLife;
import com.example.fanday.play.di.scope.PerActivity;

import dagger.Module;
import dagger.Provides;

/**
 * Created by fanday on 2017/8/13.
 */

@Module
public class ActivityModule {
    private Activity activity;

    public ActivityModule(Activity activity) {
        this.activity = activity;
    }

    @Provides
    @PerActivity
    public Activity providerActivity(){
        return activity;
    }

    @Provides
    @ContextLife(Dagger2Cons.ACTIVITY)
    @PerActivity
    public Context providerActivityContext(){
        return activity;
    }
}
